import request from '@/utils/request'

export function getList(params) {
  return request({
    url: '/manager/information/getList',
    method: 'post',
    data: params
  })
}

export function getId(id) {
  return request({
    url: `/manager/information/getModifyInfo/${id}`,
    method: 'post',
  })
}

export function delId(id) {
  return request({
    url: `/manager/information/removeInfo/${id}`,
    method: 'post',
    data: [id]
  })
}

export function delIds(params) {
  return request({
    url: '/manager/information/infoBatchOperation',
    method: 'post',
    data: params
  })
}

export function update(params) {
  return request({
    url: '/manager/information/modifyInfos',
    method: 'post',
    data: params
  })
}

export function getSections(params) {
  return request({
    url: '/manager/information/sections',
    method: 'post'
  })
}

export function getSectionCascade(params) {
  return request({
    url: '/manager/infoSection/infoSectionCascade'
  })
}

export function getInfoLabels(params) {
  return request({
    url: '/manager/infoLabel/infoLabels',
    method: 'post',
    data:params
  })
}

export function add(params) {
  return request({
    url: '/manager/information/addInfos',
    method: 'post',
    data: params
  })
}

// 资讯状态
export function auditStatus() {
  return request({
    url: '/manager/infoAudit/auditStatus',
    method: 'get'
  })
}

// 资讯待审核列表分页过滤查询
export function advisoryList(params) {
  return request({
    url: '/manager/infoAudit/drafts',
    method: 'post',
    data: params
  })
}

// 审核资讯详情
export function reviewDetail(params) {
  return request({
    url: '/manager/infoAudit/detail',
    method: 'post',
    data: params
  })
}

//审核
export function checkAdvisory(params) {
  return request({
    url: '/mgrService/mgrInformation/commitAudit',
    method: 'post',
    data: params
  })
}

// 根据资讯id分页查询评论
export function queryInfoCommentByPage(params) {
  return request({
    url: '/mgrService/mgrInformation/queryInfoCommentByPage',
    method: 'post',
    data: params
  })
}

// 根据评论id删除该条评论
export function deleteInfoCommentById(id) {
  return request({
    url: `/mgrService/mgrInformation/deleteInfoCommentById/${id}`,
    method: 'get'
  })
}
